Learn R Programming

SeuratObject (version 5.0.2)

[.Assay: Layer Data

Description

Get and set layer data

Usage

# S3 method for Assay
[(x, i = missing_arg(), j = missing_arg(), ...)

# S4 method for Assay,character,ANY,ANY [(x, i, j, ...) <- value

Value

[: The layer data for layer i

[<-: x with layer data value saved as i

Arguments

x

An Assay object

i

Name of layer data to get or set

j

Ignored

...

Arguments passed to LayerData

value

A matrix-like object to add as a new layer

See Also

LayerData

v3 Assay object, validity, and interaction methods: $.Assay(), Assay-class, Assay-validity, CreateAssayObject(), [[.Assay(), dim.Assay(), dimnames.Assay(), merge.Assay(), split.Assay(), subset.Assay()

Examples

Run this code
rna <- pbmc_small[["RNA"]]

# Get a vector of layer names in this assay
rna[]

# Fetch layer data
rna["data"][1:10, 1:4]

# Set layer data
rna["data"] <- rna["counts"]
rna["data"][1:10, 1:4]

Run the code above in your browser using DataLab